Diagnosis of Ill-typed Programs
نویسندگان
چکیده
A framework, based on syntactic and type constraints, is provided for de ning program slices that contribute to a given type error or similar syntactic property. We specify soundness, minimality and completeness criterion for these slices and outline an algorithm for their lazy generation.
منابع مشابه
Learning to Blame
Localizing type errors is challenging in languages with global type inference, as the type checker must make assumptions about what the programmer intended to do. We introduce N���, a data-driven approach to error localization based on supervised learning. N��� analyzes a large corpus of training data — pairs of ill-typed programs and their “�xed” versions — to automatically learn a model of wh...
متن کاملDynamic Witnesses for Static Type Errors
Static type errors are a common stumbling block for newcomers to typed functional languages. We present a dynamic approach to explaining type errors by generating counterexample witness inputs that illustrate how an ill-typed program goes wrong. First, given an ill-typed function, we symbolically execute the body to synthesize witness values that make the program go wrong. We prove that our pro...
متن کاملA Closer Look at Declarative Interpretations
Three semantics have been proposed as the most promising candidates for a declarative interpretation for logic programs and pure Prolog programs: the least Herbrand model, the least term model, i.e. the C-semantics, and the S-semantics. Previous results show that a strictly increasing information ordering between these semantics exists for the class of all programs. In particular, the S-semanti...
متن کاملDetecting common elements of types
We describe an algorithm approximating the following question: Given two types t1 and t2, are there instances σ(t1) and σ(t2) denoting a common element? By answering this question we solve a main problem towards a type checking algorithm for non-disjoint types that raises an error just for function calls that cannot be executed successfully. For dynamically typed functional languages such a typ...
متن کاملA Well-typed Lightweight Situation Calculus
Situation calculus has been widely applied in Artificial Intelligence related fields. This formalism is considered as a dialect of logic programming language and mostly used in dynamic domain modeling. However, type systems are hardly deployed in situation calculus in the literature. To achieve a correct and sound typed program written in situation calculus, adding typing elements into the curr...
متن کامل